package com.etc.myblog.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.etc.myblog.entity.Scolumn;

public interface ScolumnDao {
	//查询所有
	public List<Scolumn> find();
	//根据专栏id获取专栏
	public Scolumn findById(int columnId);
	//分页查询栏目
	public List<Scolumn> findPageCol(@Param("pageIndex") int pageIndex, @Param("pageSize") int pageSize);
	
	//查询栏目数量
	public int findColCount();
	
	//随机获取一个专栏
	public Scolumn findRandColumn();
	//随机获取10个专栏
	public List<Scolumn> findRandColTen();
	//根据用户id获取专栏
	public List<Scolumn> findByUserId(int userId);
	
	//根据用户id获取所有专栏
	public List<Scolumn> findAllByUserId(int userId);
	
	//获取专栏的文章数目
	public int articleCount(int columnId);
	//获取专栏的文章总浏览次数
	public int articleView(int columnId);
	
	public void update(Scolumn scolumn);
	public void updateNopic(Scolumn scolumn);
	public void add(Scolumn scolumn);
	
	
	public List<Scolumn> findNoAdSColumn();
	public void updateStatus(Scolumn sColumn);
	
}
